package com.guli.sentinel.service.controller;

import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

@RestController
@RequestMapping("/sentinel")
public class FlowLimitController {

    @GetMapping("/test")
    public String test() {
        return "接收到一条消息--------";
    }

    /**
     * 下单接口
     *
     * @return
     */
    @GetMapping("/order")
    public String order() {
        System.out.println("下单成功..........");
        return "下单成功..........";
    }

    /**
     * 支付接口
     *
     * @return
     */
    @GetMapping("/pay")
    public String pay() {
        System.out.println("支付成功..........");
        return "支付成功..........";
    }

    @GetMapping("/provider/test")
    public String providerTest() throws InterruptedException {
        //休眠3秒钟
        Thread.sleep(3000);
        System.out.println("收到一条消息----test");
        return "接收到一条消息--------";
    }
}
